import QtQuick 2.0
import "../components"

Item {


    CustomChart{
        id: chart
        anchors.fill: parent
        anchors.leftMargin: 50*dp
        anchors.rightMargin: 50*dp
        anchors.topMargin: 10*dp
        anchors.bottomMargin: 10*dp
    }

    function refresh(){
//        CRunningChart.refresh(equId, accessFilter.toString(), posiFilter.toString(), cycleNum)
        chart.init()

        let seriesList = CRunningChart.getChartData(equId, accessFilter.toString(), posiFilter.toString(), cycleNum)
//        console.log("获取到seriesList的长度:", seriesList.length)
        for(let key in seriesList){
            chart.appendCurve(key, seriesList[key]["PointList"], false, seriesList[key]["Color"])
        }
        chart.setFixedRange("minx", 1)
        chart.setFixedRange("maxx", cycleNum)
        chart.refresh()
    }

}
